<template>
  <div class="basicsMenagement-box">
    <div class="basicsMenagement-header">简述</div>
    <el-row class="tac">
      <el-col :span="12">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-s-tools"></i>
              <span>管理</span>
            </template>

            <el-menu-item-group>
              <template slot="title">分组</template>
              <el-menu-item
                index="1-1"
                v-for="(item, index) in list"
                :key="index"
                @click="tabs_click(item.path)"
              >
                <i :class="item.meta.icon"></i>
                {{item.meta.title}}
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-menu-item index="2">
            <i class="el-icon-menu"></i>
            <span slot="title">导航</span>
          </el-menu-item>

          <el-menu-item index="3">
            <i class="el-icon-document"></i>
            <span slot="title">导航</span>
          </el-menu-item>

          <el-menu-item index="4">
            <i class="el-icon-setting"></i>
            <span slot="title">导航</span>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    //   console.log(this.$router.getRoutes(),"================================");
    this.list = this.$router
      .getRoutes()
      .filter((item) => item.meta.homeChildrenPath);
    // console.log(this.list);
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
      console.log(11);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
      console.log(22);
    },
    tabs_click(path){
        console.log(path);
        this.$router.push(path)
    }
  },
};
</script>

<style scoped lang="scss">
.basicsMenagement-box {
  width: 100%;
  height: 100%;
  //   background-color: rgb(15, 28, 77);
  .basicsMenagement-header {
    width: 100%;
    height: 50px;
    background-color: rgb(84, 92, 100);
    color: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  .tac {
    width: 100%;
    height: auto;
    // background-color: rgb(15, 28, 77) !important;

    .el-col {
      width: 100%;
      //   background-color: rgb(15, 28, 77);
    }
  }
}
</style>